<template>
  <div id="addsample">
    <el-card class="box-card" style="margin:15px">
      <div style="margin-bottom:10px">
        <el-button size="small" @click="getList()">刷新</el-button>
      </div>
      <el-table
        v-loading="loading"
        :data="tableData"
        style="width: 100%;padding:5px;"
        :header-cell-style="{
          background: '#333333',
          color: '#ffffff',
          textAlign: 'center'
        }"
      >
        <el-table-column align="center" type="index" width="55" />
        <el-table-column align="center" label="操作" width="120">
          <template slot-scope="scope">
            <el-button type="text" size="small" @click="clickSetBan(scope.row)">布板</el-button>
          </template>
        </el-table-column>
        <el-table-column align="center" prop="experimentCode.data" label="项目名称" />
        <el-table-column align="center" prop="sampleCount" label="样本数" />
      </el-table>
      <el-pagination
        :current-page="pageIndex"
        :page-sizes="[10, 20, 30, 40, 50]"
        :page-size="pageSize"
        :total="tableData.length"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </el-card>

    <!-- 布板 -->
    <el-dialog
      width="90%"
      append-to-body
      id="addsample-dialog"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
      title="布板"
      :visible.sync="bubanShow"
      @close="getList"
    >
      <el-form
        ref="basicForm"
        :rules="bubanAddFormRules"
        :inline="true"
        :model="bubanAddForm"
        class="demo-form-inline"
        size="small"
        label-width="100px"
      >
        <el-row>
          <el-col :span="6">
            <el-form-item label="实验批号:" prop="batchNumber">
              <el-input size="mini" v-model="bubanAddForm.batchNumber" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="布板方案:" prop="swatchId.key">
              <el-select
                size="mini"
                v-model="bubanAddForm.swatchId.key"
                placeholder="选择"
                @change="swatchIdChanage"
              >
                <el-option
                  v-for="(item, index) in swatchList"
                  :key="index"
                  :label="item.swatchName"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="布板人员:" prop="swatchMan">
              <el-input size="mini" v-model="bubanAddForm.swatchMan" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="布板日期:" prop="swatchTime">
              <el-date-picker
                size="mini"
                v-model="bubanAddForm.swatchTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
              />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="试剂1:" prop="reagent1.key">
              <el-select size="mini" v-model="bubanAddForm.reagent1.key" placeholder="选择">
                <el-option
                  v-for="(item, index) in queryReagentList"
                  :key="index"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="试剂2:">
              <el-select size="mini" v-model="bubanAddForm.reagent2.key" placeholder="选择">
                <el-option
                  v-for="(item, index) in queryReagentList"
                  :key="index"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="质控品:" prop="qualityControl.key">
              <el-select size="mini" v-model="bubanAddForm.qualityControl.key" placeholder="选择">
                <el-option
                  v-for="(item, index) in queryQualityList"
                  :key="index"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="选中位置:">
              <el-input size="mini" disabled v-model="banItem.selectW" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="起始编号:">
              <el-input size="mini" v-model="banItem.startCode" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="终止编号:">
              <el-input size="mini" v-model="banItem.endCode" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="选中条码:">
              <el-input size="mini" disabled v-model="banItem.selectCode" placeholder="输入" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="布板方向:">
              <el-radio-group disabled v-if="direction.key">
                <el-radio-button label="heng">{{direction.data}}</el-radio-button>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <div style="display: flex;justify-content: center;margin:10px 0">
              <el-button type="primary" size="mini" @click="clickSet">设置</el-button>
              <el-button type="primary" size="mini" @click="clickSeave">保存</el-button>
              <el-button
                type="primary"
                size="mini"
                @click="clickQing"
                :disabled="bubanAddForm.swatchId.key? false: true"
              >清空布板</el-button>
            </div>
          </el-col>

          <!-- 表格 -->
          <el-col :span="10">
            <div id="ban-table-tow">
              <el-table
                v-loading="loading"
                :data="queryRecheckData"
                style="width: 100%;padding:5px;"
                :header-cell-style="{
                  background: '#333333',
                  color: '#ffffff',
                  textAlign: 'center'
                }"
                @row-dblclick="clickRowDB"
                id="sxtb"
              >
                <el-table-column align="center" type="index" width="35" />
                <el-table-column align="center" prop="expNum" label="实验编号" width="110" />
                <el-table-column align="center" prop="bloodProperty.data" label="属性" width="110" />
                <el-table-column align="center" prop="bloodReview.data" label="原血复查">
                  <template slot-scope="scope">
                    <span
                      :style="
                        scope.row.bloodReview.data == '是' ? 'color:red' : ''
                      "
                    >{{ scope.row.bloodReview.data }}</span>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="barCode" label="条形码号" width="110" />
                <el-table-column align="center" prop="bloodNum" label="采血编号" width="110" />
              </el-table>
            </div>
            <div id="ban-table-tow">
              <el-table
                v-loading="importLoading"
                :data="queryNormalData"
                style="width: 100%;padding:5px;"
                :header-cell-style="{
                  background: '#333333',
                  color: '#ffffff',
                  textAlign: 'center'
                }"
                @row-dblclick="clickRowDB"
                id="sxtb"
              >
                <el-table-column align="center" type="index" width="35" />
                <el-table-column align="center" prop="expNum" label="实验编号" width="110" />
                <el-table-column align="center" prop="bloodProperty.data" label="属性" width="110" />
                <el-table-column align="center" prop="barCode" label="条形码号" width="110" />
                <el-table-column align="center" prop="bloodNum" label="采血编号" width="110" />
                <!-- <el-table-column align="center" prop=" " label="" /> -->
                <!-- <el-table-column align="center">
                  <template slot="header" slot-scope="scope">
                    <el-upload
                      ref="upload"
                      action=""
                      :http-request="requestUpload"
                      :on-change="onChange"
                      :show-file-list="false"
                      :accept="'.xls, .xlsx'"
                      style="display: flex;align-items: center;justify-content: center;padding: 0;"
                    >
                      <el-button
                        size="small"
                        type="primary"
                        style="display: flex;align-items: center;justify-content: center;padding: 5px;"
                      >
                        导入数据
                      </el-button>
                    </el-upload>
                  </template>
                  <template slot-scope="scope"> </template>
                </el-table-column>-->
              </el-table>
            </div>
          </el-col>
          <!-- 布板 -->
          <el-col :span="14">
            <buBan
              v-if="banShow"
              @getDataList="getDataList"
              @chanageDataList="chanageDataList"
              @selectRow="selectRow"
              ref="buBanRef"
              :banTotal="banTotal"
              :dataList="banData"
              :codeList="codeList"
              :rowList="rowList"
              :columnList="columnList"
              :direction="direction"
              :rowNum="rowNum"
              :colNum="colNum"
            ></buBan>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
import { initDicts } from "@/utils/commons";
import DeliveryManageApi from "@/api/DeliveryManage.js";
import QualityManageApi from "@/api/QualityManage.js";
import ConsumableManageApi from "@/api/ConsumableManage.js";
import buBan from "@/components/ban/buBan";
import importSampleApi from "@/api/importSample.js";
import userApi from "@/api/User.js";

export default {
  components: {
    buBan
  },
  data() {
    return {
      // 是否展示更多信息
      morderShow: true,
      // 页条数
      pageSize: 10,
      // 页数
      pageIndex: 1,
      // 表格数据
      tableData: [],
      // 表格转菊花
      loading: false,
      // 表格方向
      direction: {
        data: "",
        key: "" // vertical
      },
      // 复检样本
      queryRecheckData: [],
      // 正常样本
      queryNormalData: [],
      // 复检样本转菊花
      queryRechecLoading: false,
      // 正常样本
      queryNormal: [],
      // 正常样本转菊花
      queryNormalLoading: false,
      // 布板弹窗
      bubanShow: false,
      // 正常样本表格转菊花
      importLoading: false,
      // 布板保存数据
      bubanAddForm: {
        batchNumber: "",
        direction: {
          data: "",
          key: "" // vertical
        },
        experimentCode: {
          key: ""
        },
        qualityControl: {
          key: ""
        },
        reagent1: {
          key: ""
        },
        reagent2: {
          key: ""
        },
        swatchId: {
          key: ""
        },
        swatchMan: this.$store.state.account.user.name,
        swatchTime:
          new Date().getFullYear().toString() +
          "-" +
          ((new Date().getMonth() + 1).toString() < 10
            ? "0" + (new Date().getMonth() + 1).toString()
            : (new Date().getMonth() + 1).toString()) +
          "-" +
          (new Date().getDate().toString() < 10
            ? "0" + new Date().getDate().toString()
            : new Date().getDate().toString()),
        swatchValue: []
      },
      // 板验证
      bubanAddFormRules: {
        batchNumber: [{ required: true, message: "   ", trigger: "change" }],
        "swatchId.key": [{ required: true, message: "   ", trigger: "change" }],
        swatchMan: [{ required: true, message: "   ", trigger: "change" }],
        swatchTime: [{ required: true, message: "   ", trigger: "change" }],
        "reagent1.key": [{ required: true, message: "   ", trigger: "change" }],
        "qualityControl.key": [
          { required: true, message: "   ", trigger: "change" }
        ]
      },
      // 板本地操作数据
      banItem: {
        selectW: "",
        barcode: "",
        startCode: "",
        endCode: "",
        selectCode: ""
      },
      // 布板方案
      swatchList: [],
      // 试剂
      queryReagentList: [],
      // 质控品
      queryQualityList: [],
      // 布板数据
      banData: [],
      // 板数量
      banTotal: 0,
      // 显示布板
      banShow: false,
      // 当前点击行
      clickRow: [],
      // 选中的编码
      codeList: [],
      // 布板列数
      rowList: [],
      // 布板行数
      columnList: [],
      // 文件
      file: {},
      inExpData: {
        bloodArea: "",
        deliveryDepart: "",
        deliveryId:
          new Date().getFullYear().toString() +
          ((new Date().getMonth() + 1).toString() < 10
            ? "0" + (new Date().getMonth() + 1).toString()
            : (new Date().getMonth() + 1).toString()) +
          (new Date().getDate().toString() < 10
            ? "0" + new Date().getDate().toString()
            : new Date().getDate().toString()) +
          new Date().getHours().toString() +
          new Date().getMinutes().toString() +
          new Date().getSeconds().toString(),
        deliveryMan: this.$store.state.account.user.name,
        deliveryTime:
          new Date().getFullYear().toString() +
          "-" +
          ((new Date().getMonth() + 1).toString() < 10
            ? "0" + (new Date().getMonth() + 1).toString()
            : (new Date().getMonth() + 1).toString()) +
          "-" +
          (new Date().getDate().toString() < 10
            ? "0" + new Date().getDate().toString()
            : new Date().getDate().toString())
      },
      rowNum: 0,
      colNum: 0
    };
  },
  mounted() {
    this.getList();
  },
  methods: {
    // 上传文件
    onChange(file) {
      this.file = file.raw;
    },
    // 修改上传文件地址
    requestUpload(file) {
      let that = this;
      //  表单提交方式
      let FormDatas = new FormData();
      this.importLoading = true;
      FormDatas.append("file", that.file);
      importSampleApi.applayList
        .importFile(FormDatas)
        .then(function(res) {
          if (res.data.isSuccess) {
            res.data.data.forEach(item => {
              that.queryNormalData.push(item);
            });
          } else {
            that.$message.error(res.data.data.msg);
          }
        })
        .finally(() => (this.importLoading = false));
    },
    // 过滤去重(获取布板列数)
    filRowList(arr) {
      let data = [];
      arr.forEach(item => {
        data.push(item.col);
      });
      return Array.from(new Set(data));
    },
    // 过滤去重(获取布板列数)
    filColumnList(arr) {
      let data = [];
      arr.forEach(item => {
        data.push(
          this.direction.key == "horizontal"
            ? item.r
            : item.pos.split("-")[1]
        );
      });
      return Array.from(new Set(data));
    },
    // 重置数据
    resultData() {
      this.banShow = false;
      this.bubanAddForm = {
        direction: {
          data: "",
          key: ""
        },
        batchNumber: "",
        experimentCode: {
          key: ""
        },
        qualityControl: {
          key: ""
        },
        reagent1: {
          key: ""
        },
        reagent2: {
          key: ""
        },
        swatchId: {
          key: ""
        },
        swatchMan: this.$store.state.account.user.name,
        swatchTime:
          new Date().getFullYear().toString() +
          "-" +
          ((new Date().getMonth() + 1).toString() < 10
            ? "0" + (new Date().getMonth() + 1).toString()
            : (new Date().getMonth() + 1).toString()) +
          "-" +
          (new Date().getDate().toString() < 10
            ? "0" + new Date().getDate().toString()
            : new Date().getDate().toString()),
        swatchValue: []
      };
      this.banItem = {
        selectW: "",
        barcode: "",
        startCode: "",
        endCode: "",
        selectCode: ""
      };
    },
    // 点击设置
    clickSet() {
      if (this.bubanAddForm.swatchId.key == "") {
        this.$message.error("请选择布板方案");
      } else if (this.banItem.selectW == "") {
        this.$message.error("请选择起始位置");
      } else if (
        (this.banItem.startCode != "" && this.banItem.endCode == "") ||
        (this.banItem.startCode == "" && this.banItem.endCode != "")
      ) {
        this.$message.error("编号无数字部分");
      } else if (this.banItem.startCode > this.banItem.endCode) {
        this.$message.error("起始编号不能大于终止编号");
      } else if (this.banItem.endCode - this.banItem.startCode > 2000) {
        this.$message.error("编号区间跨度过大");
      } else if (this.banItem.startCode != "" && this.banItem.endCode != "") {
        // this.codeList = [];
        // let codeList = [];
        if (
          isNaN(Number(this.banItem.startCode)) ||
          isNaN(Number(this.banItem.endCode))
        ) {
          this.$message.error("填充的实验编号不能存在英文或者特殊符号");
          return;
        }
        // for (
        //   let index = this.banItem.startCode;
        //   index < Number(this.banItem.endCode) + 1;
        //   index++
        // ) {
        //   codeList.push(index);
        // }
        // this.codeList = codeList;
        // if (this.codeList.length > 0) {
        //   setTimeout(() => {
        //     this.$refs.buBanRef.setCode();
        //   }, 300);
        // }
        let unList = []; //缺少的样本
        this.codeList = [];
        let codeList = [];
        let tableList = [...this.queryRecheckData, ...this.queryNormalData];

        tableList.forEach((item, index) => {
          if (
            item.expNum >= this.banItem.startCode &&
            item.expNum <= this.banItem.endCode
          ) {
            codeList.push(item.expNum);
          }
        });
        for (
          let index = this.banItem.startCode;
          index < Number(this.banItem.endCode) + 1;
          index++
        ) {
          if (codeList.indexOf(index.toString()) < 0) {
            unList.push(index);
          }
        }
        this.codeList = codeList;
        if (unList.length > 0) {
          this.$confirm(
            `缺少以下可布板样本(${
              unList.length
            })：<div style="width: 280px;overflow: hidden;white-space: normal;word-break: break-all;max-height:360px;overflow: auto;">${unList.toString()}</div>，是否对可布板样本进行布板？`,
            "提示",
            {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              dangerouslyUseHTMLString: true,
              type: "warning"
            }
          ).then(() => {
            if (this.codeList.length > 0) {
              setTimeout(() => {
                this.$refs.buBanRef.setCode();
              }, 300);
            }
          });
        } else {
          if (this.codeList.length > 0) {
            setTimeout(() => {
              this.$refs.buBanRef.setCode();
            }, 300);
          }
        }
      } else {
        let list = this.banData;
        let arr = list.map(item => item.s);
        this.codeList = [];
        this.queryNormalData.forEach((item, index) => {
          if (arr.indexOf(item.expNum) > -1) {
          } else {
            this.codeList.push(item.expNum);
          }
        });
        if (this.codeList.length > 0) {
          setTimeout(() => {
            this.$refs.buBanRef.setCode();
          }, 300);
        }
      }
    },
    // 点击当前行设置布板内部数据
    clickRowDB(v) {
      let list = this.banData;
      let arr = list.map(item => item.s);
      this.codeList = [];
      if (arr.indexOf(v.expNum) > -1) {
        this.$message.error(
          `此条形码号样本已经布板,位于--板${list[arr.indexOf(v.expNum)].pos}`
        );
      } else {
        this.codeList.push(v.expNum);
      }
      if (this.codeList.length > 0) {
        setTimeout(() => {
          this.$refs.buBanRef.setCode();
        }, 300);
      }
    },
    // 保存
    clickSeave() {
      this.$refs["basicForm"].validate(valid => {
        if (valid) {
          DeliveryManageApi.addSample.seave(this.bubanAddForm).then(res => {
            if (res.status === 200) {
              this.$message({
                type: "success",
                message: res.statusText
              });
              this.bubanShow = false;
              this.resultData();
            } else {
              this.$message.error(res.statusText);
            }
          });
        } else {
          return false;
        }
      });
    },
    // 清空布板
    clickQing() {
      this.$confirm("是否清空布板?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.banData.forEach(item => {
          if (item.m == "") {
            item.s = "";
          }
        });
      });
    },
    // 获取当前点击行
    selectRow(v) {
      this.clickRow = v;
      this.banItem.selectW = v.pos;
    },
    // 布板内数据变化
    chanageDataList(v) {
      var dataList = this.queryRecheckData.concat(this.queryNormalData);
      var codeList = [];
      dataList.forEach(item => {
        codeList.push(item.expNum.toString());
      });
      v.forEach((item, index) => {
        codeList.forEach(i => {
          if (item.s == i) {
            item.exist = "Y";
          }
        });
      });
      this.bubanAddForm.swatchValue = v;
    },
    // 设置共享布板
    getDataList() {
      this.banShow = false;
      this.banData = JSON.parse(localStorage.getItem("banList"));
      setTimeout(() => {
        this.banShow = true;
      }, 50);
    },
    // 选择布板方案
    swatchIdChanage(v) {
      QualityManageApi.swatchSchemeManage
        .getById(this.bubanAddForm.swatchId.key)
        .then(res => {
          this.banData = res.data.data.swatchModel;
          this.banTotal = res.data.data.swatchNum;
          this.rowNum = res.data.data.rowNum;
          this.colNum = res.data.data.colNum;
          this.direction = Object.assign({}, res.data.data.direction);
          this.bubanAddForm.direction = Object.assign(
            {},
            res.data.data.direction
          );
          this.columnList = [];
          this.rowList = [];
          this.filColumnList(res.data.data.swatchModel).forEach(
            (item, index) => {
              this.columnList[index] = {
                id:
                  this.direction.key == "horizontal"
                    ? item
                    : this.$rowData[index],
                type: ""
              };
            }
          );
          if (this.columnList[0].type != "banIndex") {
            this.columnList.unshift({ id: "1", type: "banIndex" });
          }
          this.rowList = this.filRowList(res.data.data.swatchModel); //根据布板数组过滤行数
          this.banShow = true;
          // 重置布板数据
          setTimeout(() => {
            this.$refs.buBanRef.getList();
          }, 200);
        });
    },
    // 获取数据
    getList() {
      this.loading = true;
      DeliveryManageApi.addSample
        .page({})
        .then(res => {
          this.tableData = res.data.data;
        })
        .finally(() => (this.loading = false));
      let userdata = {
        size: 9999,
        current: 1,
        sort: "id",
        order: "descending",
        model: {
          nation: { key: "" },
          education: { key: "" },
          positionStatus: { key: "" },
          org: { key: null },
          station: { key: null },
          sex: { code: "" }
        },
        map: {},
        timeRange: null
      };
      userApi.page(userdata).then(response => {
        const res = response.data;
        if (res.isSuccess) {
          res.data.records.forEach(item => {
            if (item.id == this.$store.state.account.user.id) {
              this.inExpData.deliveryDepart = item.name;
              this.inExpData.bloodArea = item.name;
            }
          });
        }
      });
    },
    // 点击布板
    clickSetBan(data) {
      this.resultData();
      this.bubanShow = true;
      this.bubanAddForm.direction = this.direction;
      this.bubanAddForm.batchNumber =
        new Date().getFullYear().toString() +
        ((new Date().getMonth() + 1).toString() < 10
          ? "0" + (new Date().getMonth() + 1).toString()
          : (new Date().getMonth() + 1).toString()) +
        (new Date().getDate().toString() < 10
          ? "0" + new Date().getDate().toString()
          : new Date().getDate().toString()) +
        new Date().getHours().toString() +
        new Date().getMinutes().toString() +
        new Date().getSeconds().toString() +
        data.experimentCode.key;
      let code = data.experimentCode.key;
      this.bubanAddForm.experimentCode = {
        key: code
      };
      // 布板+复检样本
      this.queryRechecLoading = true;
      DeliveryManageApi.addSample.queryRecheck({ code: code }).then(res => {
        this.queryRecheckData = res.data.data;
        this.queryRechecLoading = false;
      });
      // 布板+正常样本
      this.queryNormalLoading = true;
      DeliveryManageApi.addSample.queryNormal({ code: code }).then(res => {
        this.queryNormalData = res.data.data;
        this.queryNormalLoading = false;
      });
      // 方案名称
      let swatchSchemeManage = {
        current: 1,
        map: {},
        model: {
          experimentCode: {
            data: "",
            key: data.experimentCode.key
          },
          swatchName: ""
        },
        order: "descending",
        size: 10,
        sort: "id"
      };
      QualityManageApi.swatchSchemeManage.page(swatchSchemeManage).then(res => {
        this.swatchList = res.data.data.records;
      });

      // 试剂名称
      ConsumableManageApi.reagentManage
        .queryReagent({ code: code })
        .then(res => {
          this.queryReagentList = res.data.data;
        });
      // 试剂名称
      ConsumableManageApi.reagentManage
        .queryQuality({ code: code })
        .then(res => {
          this.queryQualityList = res.data.data;
        });
      // // 导入前调用
      // DeliveryManageApi.acceptanceTesting
      //   .inExpress(this.inExpData)
      //   .then(res => {});
    },
    //点击全选
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    // 点击分页
    handleSizeChange: function(val) {
      this.pageSize = val;
    },
    // 选择页码
    handleCurrentChange: function(currentPage) {
      this.pageIndex = currentPage;
    }
  }
};
</script>
<style lang="less">
#addsample-dialog {
  display: flex;
  justify-content: center;
  align-items: center;
  .el-dialog {
    margin-top: 0 !important;
  }
  .el-message-box__message {
    width: 280px;
    overflow: hidden;
    white-space: normal;
    word-break: break-all;
  }
  #ban-table-tow {
    .el-table__body-wrapper {
      height: 200px !important;
      overflow-y: auto;
    }
    #sxtb {
      td {
        padding: 5px 0 !important;
      }
      th {
        padding: 5px 0 !important;
      }
    }
  }
  .el-dialog__title {
    color: #fff;
  }
  .el-form-item__content {
    width: 80%;
    .el-select {
      width: 100%;
    }
    .el-date-editor {
      width: 100%;
    }
  }
}
</style>
